<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>


<!--
  实现100以内偶数和奇数的和分别是多少
-->

<script>
    //奇数和
    var sum1 = 0
    // 偶数和
    var sum2 = 0

    for (var i = 1; i <101 ; i++) {

        if(i%2){
            sum1+=i;
        }else{
            sum2+=i;
        }

    }
    console.log("奇数和="+sum1);
    console.log("偶数和="+sum2);
</script>
</body>
</html>